package com.wanmait.houlang.controller;

import com.wanmait.houlang.pojo.Subject;
import com.wanmait.houlang.service.SubjectService;
import com.wanmait.houlang.util.Result;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/webContent")
public class SubjectController {
    @Resource
    private SubjectService subjectService;

    @GetMapping("subject")
    public Result searchAllSubject(){
        List<Subject> all = subjectService.findAll();
        return Result.success(all);
    }
}
